﻿@model AvatarViewModel
@{
    Layout = "~/Views/Shared/_User.cshtml";
}
<div class="user_cp_avatar section">
    <h2>Avatar</h2>

    <div class="current_avatar">
        @if (Model.AvatarType == AvatarType.None)
        {
            <p>No Avatar</p>
        }
        else
        {
            @Html.UserAvatar(Model.CurrentUser.UserID) 
            <p>Current Avatar</p>
        }        
    </div>
    <div class="avatar_option">
        <form method="post" enctype="multipart/form-data" action="">

            <ul>
                <li>
                    @Html.RadioButtonFor(model => model.AvatarType, AvatarType.None, new { id = "avatar_none" })
                    <label for="avatar_none">None</label>
                </li>
                <li>
                    @Html.RadioButtonFor(model => model.AvatarType, AvatarType.Url, new { id = "avatar_url" })
                    <label for="avatar_url">External Image URL</label>
                    <br />
                    @Html.TextBoxFor(model => model.Url, new { style = "width: 300px" })
                    @Html.ValidationMessageFor(model => model.Url)
                    <label class="info">Image will be resized to @(Model.WidthMax)px by @(Model.HeightMax)px</label>
                </li>
                <li>
                    @Html.RadioButtonFor(model => model.AvatarType, AvatarType.Upload, new { id = "avatar_upload" })
                    <label for="avatar_upload">Upload Avatar Image</label>
                    <br />
                    <input type="file" name="Image" />
                    @Html.ValidationMessageFor(model => model.Image) 
                    <label class="info">
                        png,gif,jpeg,jpg only<br />
                        @(Model.WidthMax)px by @(Model.HeightMax)px
                    </label>   
                </li>
            </ul>
            <p>
                <input type="submit" name="Password" value="Save Changes" />
            </p>
        </form>
    </div>
</div>